<template>
    <van-tabbar v-model="active" placeholder route>
        <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
        <van-tabbar-item icon="search" to="/fenlei">分类</van-tabbar-item>
        <van-tabbar-item icon="friends-o" to="/cart" :badge="responseDatalength">购物车</van-tabbar-item>
        <van-tabbar-item icon="setting-o" to="/user">我的</van-tabbar-item>
    </van-tabbar>
</template>

<script setup lang='ts'>
import { onMounted, ref, watch, computed } from 'vue';
import { lookcart } from '@/api/http';
const responseData = ref()
const responseDatalength = ref()
onMounted(() => {
    lookcart({ shop_userCode: localStorage.getItem('user_code') }).then((res: any) => {
        console.log('购物车列表', res);
        responseData.value = res.responseData
        responseDatalength.value = res.responseData.length
    })
})
const active = ref(0);
</script>
<style lang="scss">

</style>/